<template>
  <div>
    <div>日志审计</div>
    <el-card class="box-card" shadow="never">
      <div class="search-list">
        <el-form :inline="true" :model="formInline" class="form-inline">
          <el-form-item label="">
            <el-input
              v-model="formInline.phone"
              placeholder="输入用户id"
            />
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="onSubmit">搜索</el-button>
          </el-form-item>
        </el-form>
      </div>
      <el-table
        :data="tableData"
        style="width: 100%; margin-bottom: 20px;"
      >
        <el-table-column type="expand">
          <template slot-scope="props">
            <el-form label-position="left" inline>
              <el-form-item label="商品名称">
                <span>{{ props.row.name }}</span>
              </el-form-item>
              <el-form-item label="所属店铺">
                <span>{{ props.row.shop }}</span>
              </el-form-item>
              <el-form-item label="商品 ID">
                <span>{{ props.row.id }}</span>
              </el-form-item>
              <el-form-item label="店铺 ID">
                <span>{{ props.row.shopId }}</span>
              </el-form-item>
              <el-form-item label="商品分类">
                <span>{{ props.row.category }}</span>
              </el-form-item>
              <el-form-item label="店铺地址">
                <span>{{ props.row.address }}</span>
              </el-form-item>
              <el-form-item label="商品描述">
                <span>{{ props.row.desc }}</span>
              </el-form-item>
            </el-form>
          </template>
        </el-table-column>
        <el-table-column prop="date" label="用户ID" width="180" />
        <el-table-column prop="name" label="手机号" />
        <el-table-column prop="name" label="请求状态" />
        <el-table-column prop="name" label="服务器名称" />
        <el-table-column prop="name" label="路由" />
        <el-table-column prop="endDate" label="操作时间" />
      </el-table>
      <el-pagination
        size="large"
        style="text-align:right;"
        background
        :page-sizes="[10, 20, 30, 40]"
        layout="sizes, prev, pager, next"
        :current-page.sync="pagination.current"
        :page-size="pagination.pageSize"
        :total="pagination.total"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formInline: {
        phone: "",
        nickName: ""
      },
      pagination: {
        current: 1,
        pageSize: 10,
        total: 0
      },
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄"
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄"
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1519 弄"
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1516 弄"
        }
      ]
    };
  },
  methods: {
    handleSizeChange() {},
    handleCurrentChange() {},
    // 提交表单
    onSubmit() {
      console.log(this.formInline, `this.formInline`);
    }
  }
};
</script>

<style lang="css" scoped>
.box-card {
  margin-top: 20px;
}
.form-inline {
  margin-top: 20px;
}
</style>
